﻿

$(document).ready(function () {

    $("#login").click(function () {
        var email = $("#txtEmail").val().trim();
        var pass = $("#txtPassWord").val().trim();
        if (email == "") {
            $("#emailMsg").html("Email信息不能为空！");
            return;
        }

        if (pass == "") {
            $("#passwordMsg").html("密码不能为空！");
            return;
        }

        var result = RuiZhiSZSLSystem.Web.Login.UserLogin(email, pass).value;
        if (result > 0) {
            window.location.href = "Member/Index.aspx";
        }
        else {
            $("#msg").innerHTML = "Email或密码错误！";
        }
    });

    //检查会员Email
    $("#txtRegEmail").blur(function () {
        var email = $("#txtRegEmail").val().trim();

        if (email == "") {
            $("#Email").innerHTML() = "EMail不正确!";
            return;
        }

        var result = RuiZhiSZSLSystem.Web.UserRegister.CheckEMail(email).value;

        if (!result) {
            $("RegisterMsg").innerHTML = "可以使用！";
        }
        else {
            $("RegisterMsg").innerHTML = "已存在！";
        }
    });



});   